package com.xxwy.springbootwebfluxclient.controller;

import com.xxwy.springbootwebfluxclient.api.IUserApi;
import com.xxwy.springbootwebfluxclient.document.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import reactor.core.publisher.Mono;

/**
 * @author xxwy
 */
@org.springframework.web.bind.annotation.RestController
public class RestController {

    @Autowired
    IUserApi iUserApi;

    @GetMapping("/")
    public void test(){
//        iUserApi.delectUserById("111111111");
        Mono<User> xxwy = iUserApi.createUser(
                Mono.just((User.builder().name("xxwy").age(5).build())));
        xxwy.subscribe(System.out::println);
//        Flux<User> users = iUserApi.getAllUser();
//        users.subscribe(System.out::println);
    }
}

